<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form>
    <ul>
        <li>
            <input class="list-content" type="text" value="PhP">
            <a class="list-up" onclick="up()">[上移]</a>
            <a class="list-down">[下移]</a>
            <a class="list-del">[删除]</a>
        </li>
        <li>
            <input class="list-content" type="text" value="Js">
            <a class="list-up" onclick="up()">[上移]</a>
            <a class="list-down">[下移]</a>
            <a class="list-del">[删除]</a>
        </li>
    </ul>
</form>
</body>
<script>
    var list_up=document.getElementsByClassName("list-up");
    var list_content=document.getElementsByClassName("list-content");
    var list_up_one=list_up[1].parentNode
    function up(){
        // console.log(list_up[1].previousSibling)
        // list_up_one.insertBefore(list_up[0].previousSibling,list_up[1].previousSibling)
    }
    console.log(list_up_one)
    Find.prototype.prev=function () {
        var node=this.obj.previousSibling;//获取当前元素对象的前一个节点
        while (node){
            if (node.nodeType===Node.ELEMENT_NODE){
                break;
            }
            node=node.previousSibling;
        }
        return node;
    };
    Find.prototype.next=function () {
        var node = this.obj.nextSibling;
        while (node) {
            if (node.nodeType === Node.ELEMENT_NODE) {
                break
            }
            node = node.nextSibling;
        }
        return node;
    }
    var obj=this.obj;
    list_up.onclick=function () {
        var prev=find.prev();
        if (prev){
            obj.insertBefore(tmp,prev);
        }else {
            alert("已经式第一个")
        }
    }
</script>
</html>